<include file="public/layout" />
<body style="background-color: rgb(255, 255, 255); overflow: auto; cursor: default;">
<div class="page">
  <div class="fixed-bar">
    <div class="item-title">
      <div class="subject">
        <h3>拍卖商品管理</h3>
        <h5>拍卖商品与管理</h5>
      </div>
    </div>
  </div>
  <div id="explanation" class="explanation">
    <div id="checkZoom" class="title"><i class="fa fa-lightbulb-o"></i>
      <h4 title="提示相关设置操作时应注意的要点">操作提示</h4>
      <span title="收起提示" id="explanationZoom"></span>
    </div>
    <ul>
      <li style="color:#ff0000;"><strong>"是否显示"->设置为显示之后, 该商品会在首页楼层显示</strong></li>
    </ul>
  </div>
  <form method="post">
    <input type="hidden" value="ok" name="form_submit">
    <div class="flexigrid">
      <div class="mDiv">
        <div class="ftitle">
          <h3>拍卖商品列表</h3>
          <h5>(共{$pager->totalRows}条记录)</h5>
        </div>
        <a href=""><div title="刷新数据" class="pReload"><i class="fa fa-refresh"></i></div></a>
        <form id="search-form2" class="navbar-form form-inline"  method="post" action="{:U('Daili/sale/cate')}">
          <div class="sDiv">      
            <div class="sDiv2">
              <if condition="$_POST['state'] eq 'yes'">
                0
              </else> 
              1
              </if>
               <select name="state" class="select">
          
                   <option value="shen">审核状态</option>
                   <option value="1" <if condition="$_POST['state'] eq 1">selected</if>>未审核</option>
                   <option value="2" <if condition="$_POST['state'] eq 2">selected</if>>通过</option>
                   <option value="3" <if condition="$_POST['state'] eq 3">selected</if>>未通过</option>
              </select>
             <!--  <select name="state" class="select">
                <if condition="$_POST['state'] eq 1">
                   <option value="shen">审核</option>
                   <option value="1" selected>未审核</option>
                   <option value="2">已审核</option>
                   <option value="3">未通过</option>
                <elseif condition="$_POST['state'] eq 2">
                    <option value="shen">审核</option>
                    <option value="1">未审核</option>
                    <option value="2"  selected>已审核</option>
                    <option value="3">未通过</option>
                <elseif condition="$_POST['state'] eq 3">
                    <option value="shen">审核</option>
                    <option value="1">未审核</option>
                    <option value="2">已审核</option>
                    <option value="3" selected>未通过</option>
                <else/>
                    <option value="shen">审核</option>
                    <option value="1">未审核</option>
                    <option value="2">已审核</option>
                    <option value="3">未通过</option>
               </if>
              </select> -->
              <input type="text" class="qsbox" id="input-order-id" placeholder="搜索词" value="{$_POST['keyword']}" name="keyword">                                        
              <input type="submit" class="btn" value="搜索">
            </div>
          </div>
         </form>
      </div>
      <div class="hDiv">
        <div class="hDivBox">
          <table cellspacing="0" cellpadding="0">
            <thead>
              <tr>
                <th align="center" axis="col0" class="sign"  onclick="checkAllSign(this)">
                  <div style="text-align: center; width: 24px;"><i class="ico-check"></i></div>
                </th>
                <th align="center" axis="col2"><div style="text-align: center; width: 60px;">ID</div></th>
                <th align="center" axis="col3"><div style="text-align: center; width: 300px;">商品名称</div></th>
                <th align="center" axis="col6"><div style="text-align: center; width: 100px;">分类</div></th>
                <th align="center" axis="col6"><div style="text-align: center; width: 100px;">价格</div></th>
                <th align="center" axis="col6"><div style="text-align: center; width: 100px;">加价金额</div></th>
                <th align="center" axis="col6"><div style="text-align: center; width: 150px;">开始时间</div></th>
                <th align="center" axis="col6"><div style="text-align: center; width: 150px;">结束时间</div></th>
    <!--             <th align="center" axis="col9"><div style="text-align: center; width: 80px;">推荐</div></th> -->
                <th align="center" axis="col9"><div style="text-align: center; width: 80px;">排序</div></th>
                <th align="center" axis="col9"><div style="text-align: center; width: 80px;">拍卖状态</div></th>
                <th align="center" axis="col9"><div style="text-align: center; width: 80px;">审核状态</div></th>
                <th align="center" axis="col9"><div style="text-align: center; width: 250px;">操作</div></th>                
                <th axis="col10"><div></div></th>
              </tr>
            </thead>
          </table>
        </div>
      </div>
      <div class="tDiv">
        <div class="tDiv2">
        
          <div class="fbutton">
            <a href="{:U('sale/addeditsale')}">
              <div title="发布拍卖商品" class="add">
                <span><i class="fa fa-plus"></i>发布拍卖商品</span>
              </div>
            </a>  
          </div>

          <div class="fbutton">
              <a href="javascript:;" onclick="publicHandleAll('del')">
                  <div class="add" title="批量删除">
                      <span>批量删除</span>
                  </div>
              </a>
          </div>
        </div>
        <div style="clear:both"></div>
      </div>      
      <div style="height: auto;" class="bDiv" id="flexigrid"  data-url="{:U('sale/delsale')}">
        <table cellspacing="0" cellpadding="0" border="0" id="article_cat_table" class="flex-table autoht">
          <tbody id="treet1">
         <foreach name="cate" item="vo" key="k" >
          <tr  data-id="{$vo[id]}">
              <td class="sign">
                  <div style="width: 24px;"><i class="ico-check"></i></div>
              </td>
              <td class="sort">
                <div style="text-align: center; width: 60px;">{$vo.id}</div>
              </td>
              <td class="sort">
                <div style="text-align: center; width: 300px;">{$vo.sname}</div>
              </td>
              <td class="sort">
                <div style="text-align: center; width: 100px;">{$vo.name}</div>
              </td>
              <td class="sort">
                <div style="text-align: center; width: 100px;">{$vo.shop_price}</div>
              </td>
              <td class="sort">
                <div style="text-align: center; width: 100px;">{$vo.market_price}</div>
              </td>
              <td class="sort">
                <div style="text-align: center; width: 150px;">{$vo.starttime|date='Y-m-d H:i:s',###}</div>
              </td>
              <td class="sort">
                <div style="text-align: center; width: 150px;">{$vo.endtime|date='Y-m-d H:i:s',###}</div>
              </td>
            <!--   <td align="center" class="">
                  <div style="text-align: center; width: 80px;">
                    <if condition='$vo[is_hot] eq 1'>
                      <span class="yes" onClick="changeTableVal('sale','id','{$vo.id}','is_hot',this)" ><i class="fa fa-check-circle"></i>是</span>
                      <else />
                      <span class="no" onClick="changeTableVal('sale','id','{$vo.id}','is_hot',this)" ><i class="fa fa-ban"></i>否</span>
                    </if>
                  </div>
              </td> -->
              <td align="center">
                <div style="text-align: center; width: 80px;">
                  <input type="text" onKeyUp="this.value=this.value.replace(/[^\d]/g,'')" onpaste="this.value=this.value.replace(/[^\d]/g,'')" onblur="changeTableVal('sale','id','{$vo.id}','sort',this)" size="4" value="{$vo.sort}" style="text-align: center;"/>
                </div>
              </td>     
              <td class="sort">
                <div style="text-align: center; width: 80px;">
                  <if condition="time() gt $vo.endtime"> 
                    已结束
                  <elseif condition="time() egt $vo.starttime and time() elt $vo.endtime">
                    进行中
                  <else/> 
                    未开始
                  </if>
                </div>
              </td> 
              <td>
            <div style="text-align: center; width: 80px;">
              <if condition="$vo.state eq 1">
                通过
              <elseif condition="$vo.state eq 0">  
                未通过
              <else/> 
                未审核
              </if>
            </div>
              </td>                                                                
              <td align="center" class="handle">
                  <div style="text-align: center; width: 300px;">                    
                    <a class="btn red"  href="javascript:void(0)"  onclick="publicHandle('{$vo[id]}','del')" ><i class="fa fa-trash-o"></i>删除</a>
         <!--            <a href="{:U('Daili/sale/editsale',array('id'=>$vo['id'],'p'=>$_GET[p]))}" class="btn blue"><i class="fa fa-pencil-square-o"></i>编辑商品</a>  -->
                  <span class="btn"><em><i class="fa fa-cog"></i>设置<i class="arrow"></i></em>
                  <ul>
                    <li><a href="{:U('Daili/sale/editsale',array('id'=>$vo['id'],'p'=>$_GET[p]))}">编辑商品信息</a></li>
                    <li><a href="{:U('Home/sale/goodsInfo',array('id'=>$vo['id'],'p'=>$_GET[p]))}" target="_blank">预览商品信息</a></li>
                    <li><a href="{:U('Daili/sale/order',array('id'=>$vo['id'],'p'=>$_GET[p]))}">查看订单详情</a></li>
                  </ul>
                  </span>
                  </div>  
              </td>       
              <td style="width: 100%;">
                <div>&nbsp;</div>
              </td>
            </tr>
           </foreach>                                 
          </tbody>
        </table>     
        <!--分页位置--> {$show}</div>     
      </div>
    </div>
</div>
<script>
    // 表格行点击选中切换
    $(document).on('click','#flexigrid > table>tbody >tr',function(){
        $(this).toggleClass('trSelected');
        var checked = $(this).hasClass('trSelected');
        $(this).find('input[type="checkbox"]').attr('checked',checked);
    });

  /* $(document).ready(function () {
        // ajax 加载商品列表
        ajax_get_table('search-form2', 1);

    });

    // ajax 抓取页面 form 为表单id  page 为当前第几页
    function ajax_get_table(form, page) {
        cur_page = page; //当前页面 保存为全局变量
        $.ajax({
            type: "POST",
            url: "/index.php?m=Admin&c=goods&a=ajaxGoodsList&p=" + page,//+tab,
            data: $('#' + form).serialize(),// 你的formid
            success: function (data) {
                $("#flexigrid").html('');
                $("#flexigrid").append(data);
            }
        });
    }*/
</script>
</body>
</html>